package com.lys.blog.dao.pojo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.beans.BeanUtils;

@Data
@NoArgsConstructor
public class Student {
    private int id;
    private String name;
    private int age;

    public static void main(String[] args) {
        Student student = new Student();
        student.id = 1;
        student.name = "李明";
        student.age = 22;
        System.out.println(student);
        People people = new People();
        System.out.println("复制属性前："+people);
        BeanUtils.copyProperties(student, people);
        System.out.println("复制属性后："+people);
    }
}
@AllArgsConstructor
@NoArgsConstructor
@Data
class People{
    String names;
    int nums;

}
